var Setup = {
	agree : function() {
		window.location.href = "setup/setting.jsp";
	},
	notagree : function() {
		alert('请在开始菜单中卸载本程序，谢谢');
	},
	ping : function() {
		$('#mesgarea').hide();
		$.post('../Ping', Setup.data(), function(data) {
			$('#consoleMessage').html(data);
			$('#mesgarea').show();
			if ('SUC' == data) {
				$('#consoleMessage').html('数据库连接成功，点确定进行安装');
				$('#successping').removeAttr('disabled');
			}
		}, 'html');
	},
	install : function() {
		$.post('../Ping', Setup.data(), function(data) {
			if ('SUC' == data) {
				$.post('../Install',{type:'mysql'}, function(data) {
					alert(data);
				});
			}else{
				alert(data);
			}
		});
	},
	data : function(){
		var data = {};
		data['host'] = $('input[name=host]').val();
		data['port'] = $('input[name=port]').val();
		data['dbname'] = $('input[name=dbname]').val();
		data['username'] = $('input[name=username]').val();
		data['passwd'] = $('input[name=passwd]').val();
		data['copyright'] = $('input[name=copyright]').val();
		data['sequence'] = $('input[name=sequence]').val();
		data['createDb'] = $('input[name=createDb]:checked').val();
		data['dbtype'] = 'mysql';
		return data;
	}
}